﻿Imports HensonOnline

Partial Class photoalbums_viewImage
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim imgId As Integer = Request.QueryString("imgId")

        Dim image As New Image
        image.GetImage(imgId, User.Identity.Name)

        If image.IsPrivate = True And image.UserId <> User.Identity.Name Then
            imgTitle.InnerText = "Private Image"
            img.Visible = False
            ownerId.InnerText = fn.GetUserName(image.UserId)
            imgCaption.InnerText = "This image is currently marked private."
        Else
            imgTitle.InnerText = image.Title
            img.Src = fn.GetImagePath(image.FilePath)
            ownerId.InnerText = fn.GetUserName(image.UserId)
            imgCaption.InnerText = image.Caption
            commentCount.InnerText = image.Comment
        End If


    End Sub
End Class
